package zw_501_600.zw_551_学生出勤记录I;

class Solution {

    public static void main(String[] args) {
        String s = "ALLAPPL";
        boolean b = checkRecord(s);
        System.out.println(b);
    }

    public static boolean checkRecord(String s) {
        int absen = 0, late = 0;
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c == 'A') {
                absen++;
                if (absen >= 2) return false;
            }
            if (c == 'L') {
                late++;
                if (late >= 3) return false;
            } else {
                late = 0;
            }
        }
        return true;
    }
}
